<?php

	class JsonComponent extends Object {

    /**
     * Generate Json error
     */
    function error($id = null){
      $error = array('error'=>$id);
		echo json_encode($error);
		exit();
    }

    /**
     * Generate Json result
     */
    function result($id = null){
      $result = array('result'=>$id);
		echo json_encode($result);
		exit();
    }

    /**
     * Convert input as Json array
     */
    function show($id){
       echo json_encode($id);
       exit();
    }

}
?>
